<?php
class AES
{
    public static function encrypt($data, $key) {
        $data =  openssl_encrypt($data, 'aes-128-ecb', base64_decode($key), OPENSSL_RAW_DATA);
        return base64_encode($data);
    }
    public static function decrypt($data, $key) {
        $encrypted = base64_decode($data);
        return openssl_decrypt($encrypted, 'aes-128-ecb', base64_decode($key), OPENSSL_RAW_DATA);
    }
}

$key = "p05ReNyGQK7jOOtLM8dWtA==";
$data = "abc123!@#";
$value = AES::encrypt($data , $key );
echo "加密字符串：".$value;
echo "解密字符串：".AES::decrypt($value, $key );
//echo "    20201222    ";
//echo "解密字符串：".AES::decrypt("nqPprmFX6CJToCNTpB85bQ==", $key );
?>
